import store from '@/store'

export default {
  inserted: (el, binding) => {
    // 先拿到用户所有权限
    const points = store.state.user.userInfo.roles.points
    // el为绑定元素,binding为v-power传进来的值,指令绑定的值
    if (!points.includes(binding.value)) {
      // 删除元素本身
      el.parentNode.removeChild(el)
    }
  }
}
